package com.ruoyi.food.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.food.mapper.WarehouseOutMapper;
import com.ruoyi.food.domain.WarehouseOut;
import com.ruoyi.food.service.IWarehouseOutService;

/**
 * 粮食出库Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-13
 */
@Service
public class WarehouseOutServiceImpl implements IWarehouseOutService 
{
    @Autowired
    private WarehouseOutMapper warehouseOutMapper;

    /**
     * 查询粮食出库
     * 
     * @param id 粮食出库主键
     * @return 粮食出库
     */
    @Override
    public WarehouseOut selectWarehouseOutById(Long id)
    {
        return warehouseOutMapper.selectWarehouseOutById(id);
    }

    /**
     * 查询粮食出库列表
     * 
     * @param warehouseOut 粮食出库
     * @return 粮食出库
     */
    @Override
    public List<WarehouseOut> selectWarehouseOutList(WarehouseOut warehouseOut)
    {
        return warehouseOutMapper.selectWarehouseOutList(warehouseOut);
    }

    /**
     * 新增粮食出库
     * 
     * @param warehouseOut 粮食出库
     * @return 结果
     */
    @Override
    public int insertWarehouseOut(WarehouseOut warehouseOut)
    {
        warehouseOut.setCreateTime(DateUtils.getNowDate());
        return warehouseOutMapper.insertWarehouseOut(warehouseOut);
    }

    /**
     * 修改粮食出库
     * 
     * @param warehouseOut 粮食出库
     * @return 结果
     */
    @Override
    public int updateWarehouseOut(WarehouseOut warehouseOut)
    {
        warehouseOut.setUpdateTime(DateUtils.getNowDate());
        return warehouseOutMapper.updateWarehouseOut(warehouseOut);
    }

    /**
     * 批量删除粮食出库
     * 
     * @param ids 需要删除的粮食出库主键
     * @return 结果
     */
    @Override
    public int deleteWarehouseOutByIds(Long[] ids)
    {
        return warehouseOutMapper.deleteWarehouseOutByIds(ids);
    }

    /**
     * 删除粮食出库信息
     * 
     * @param id 粮食出库主键
     * @return 结果
     */
    @Override
    public int deleteWarehouseOutById(Long id)
    {
        return warehouseOutMapper.deleteWarehouseOutById(id);
    }
}
